
use “data_for_tables.dta" 


***************************************
***    TABLES 1 & 2                 ***
***************************************
* see RATS code: .rpf


***************************************
***   from RATS: tau_hat = -0.0950  ***
***************************************
capture: drop fdu2_above0095 fdu2_below0095 resid_symm resid_asymm


gen fdu2_above0095 = fdu2
replace fdu2_above0095 = 0 if fdu2 < -0.0950

gen fdu2_below0095 = fdu2
replace fdu2_below0095 = 0 if fdu2 >= -0.0950 & fdu2!=.


***************************************
***    TABLE 3: MAIN RESULTS        ***
***************************************

*** Model (1) Symmetric Model fdGOV = fdUNEMP + fdINFLATION ***
reg fdgovsi fdu2 fdi
est store sym
predict resid_symm, resid
estat ic
dwstat
wntestq resid_symm

*** Model (2) Asymmetric Model fdGOV = fdUNEMP[>t] + fdUNEMP[<t] + fdINFLATION ***
reg fdgovsi fdu2_above0095 fdu2_below0095 fdi
est store asym
predict resid_asymm, resid
estat ic
dwstat
wntestq resid_asymm

estout sym asym, cells(b(star fmt(%9.3f)) se(par)) starlevels(* 0.10 ** 0.05 *** 0.01) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) legend style(smcl) varlabels(_cons Constant)
estout sym asym, cells(b(star fmt(%9.3f)) se(par)) starlevels(* 0.10 ** 0.05 *** 0.01) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) legend style(tex) varlabels(_cons Constant)


*** Likelihood ratio test M(1) vs M(2) ***

lrtest sym asym


*** Test that coefficients are different: ***

reg fdgovsi fdu2_above0095 fdu2 fdi



***************************************
***  TABLE 4: ROBUSTNESS CHECKS     ***
***************************************

*** Fractionally differencing interventions: ***
fracdiff iiraqwar2003m3 ,d(.88) gen( fd_iiraqwar2003m3  )
fracdiff ielection1992m4 ,d(.88) gen( fd_ielection1992m4  )
fracdiff iblackwed1992m10 ,d(.88) gen( fd_iblackwed1992m10  )
fracdiff icameron ,d(.88) gen( fd_icameron  )
fracdiff ibrown ,d(.88) gen( fd_ibrown  )
fracdiff igulfwar1991m1 ,d(.88) gen( fd_igulfwar1991m1  )
fracdiff iblair ,d(.88) gen( fd_iblair  )
fracdiff imajor ,d(.88) gen( fd_imajor  )
fracdiff ifalklands1982m5 ,d(.88) gen( fd_ifalklands1982m5  )
fracdiff iseptember11 ,d(.88) gen( fd_iseptember11  )


foreach var of varlist election1979 election1983 election1987 election1992 election1997 election2001 election2005 election2010 {
fracdiff `var' ,d(.88) gen( fd_e_`var' )
}

*** replacing missing values in first year after fracdiff ***
foreach var of varlist fd_iiraqwar2003m3 fd_iblackwed1992m10 fd_icameron fd_ibrown fd_igulfwar1991m1 fd_iblair fd_imajor fd_ifalklands1982m5 fd_iseptember11  fd_e_election1983 fd_e_election1987 fd_e_election1992 fd_e_election1997 fd_e_election2001 fd_e_election2005 fd_e_election2010 {
replace `var'= 0 if `var'==. & year<1981
}

***************************************
***   Model (3): Interventions      ***
***************************************

reg fdgovsi fdu2_above0095 fdu2_below0095 fdi fd_iiraqwar2003m3 fd_iblackwed1992m10 fd_icameron fd_ibrown fd_igulfwar1991m1 fd_iblair fd_imajor fd_ifalklands1982m5 fd_iseptember11  fd_e_election1983 fd_e_election1987 fd_e_election1992 fd_e_election1997 fd_e_election2001 fd_e_election2005 fd_e_election2010
est store intervention1
predict resid_interv, resid
estat ic
dwstat
wntestq resid_interv


*reg fdgovsi fdu2_above0095 fdu2_below0095 fdi l(0/2).(fd_iiraqwar2003m3 fd_iblackwed1992m10 fd_icameron fd_ibrown fd_igulfwar1991m1 fd_iblair fd_imajor fd_ifalklands1982m5 fd_iseptember11  fd_e_election1983 fd_e_election1987 fd_e_election1992 fd_e_election1997 fd_e_election2001 fd_e_election2005 fd_e_election2010)
*est store intervention2


estout intervention1 , cells(b(star fmt(%9.3f)) se(par)) starlevels(* 0.10 ** 0.05 *** 0.01) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) legend style(smcl) varlabels(_cons Constant)
estout intervention1 , cells(b(star fmt(%9.3f)) se(par)) starlevels(* 0.10 ** 0.05 *** 0.01) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) legend style(tex) varlabels(_cons Constant)


*** Alternative, simpler models (4 and 5) ***

capture: drop duabovezero dubelowzero
gen duabovezero = du
replace duabovezero = 0 if du < 0
gen dubelowzero = du
replace dubelowzero = 0 if du >= 0 & du!=.

***  BRACKETING: either I(0) or I(1): ***


***************************************
***   Model (4): ARIMA (1,0,0).     ***
***************************************

arima govsi l2.duabovezero l2.dubelowzero di, ar(1)
est store arima100
predict resid_arima100, resid
estat ic
dwstat
wntestq resid_arima100 


***************************************
***   Model (5): ARIMA (0,1,0)      ***
***************************************

reg dgovsi l2.d.duabovezero l2.d.dubelowzero di
est store arima010
predict resid_arima010, resid
estat ic
dwstat
wntestq resid_arima010



estout arima100 arima010, cells(b(star fmt(%9.3f)) se(par)) starlevels(* 0.10 ** 0.05 *** 0.01) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) legend style(smcl) varlabels(_cons Constant)
estout arima100 arima010, cells(b(star fmt(%9.3f)) se(par)) starlevels(* 0.10 ** 0.05 *** 0.01) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) legend style(tex) varlabels(_cons Constant)


estout intervention1 arima100 arima010 , cells(b(star fmt(%9.3f)) se(par)) starlevels(* 0.10 ** 0.05 *** 0.01) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) legend style(smcl) varlabels(_cons Constant)
estout intervention1 arima100 arima010, cells(b(star fmt(%9.3f)) se(par)) starlevels(* 0.10 ** 0.05 *** 0.01) stats(r2 N, fmt(%9.3f %9.0g) labels(R-squared)) legend style(tex) varlabels(_cons Constant)






